About Music Object Extensions
|
|
Beatnik Inc. is excited to be able to expand the Music Object API further through the use of modular extensions that do not increase the code size of the core Music Object API (Beatnik Inc. has made a commitment to freeze the size of the core Music Object API's code). Our goal is to make your life as a developer of sonified content easier, and to help you to create awesome content enhanced by the power of Beatnik's interactive music and audio capabilities.
What are Extensions?
Music Object extensions are modular JavaScript files that are geared towards different types of sonification needs. For example, Music Object Extension - Groups is ideal for making remix interfaces easier to code. And Music Object Extension - Dynamic is ideal for making sonified Web pages remain fresh and entertaining, and to encourage repeat visits.
What are the Benefits of Extensions?
- they extend the core Music Object API with higher level features useful for sonification
- they don't increase the size of the core Music Object API
- they are modular and can be used in different combinations as needed
- they add value to the Music Object sonification API
- building extensions is open to third party developers
How Does One Use Extensions?
Using the Music Object extensions is easy. Extensions are simply JavaScript files like the "music-object.js" file that can be sourced into sonified pages as needed. In the following example, Music Object Extension - Groups and Music Object Extension - Dynamic are being used...
<HTML><TITLE>Page Using Music Object Extensions</TITLE></HTML>
<BODY>
<SCRIPT SRC="music-object.js"></SCRIPT>
<SCRIPT SRC="music-object-x-groups.js"></SCRIPT>
<SCRIPT SRC="music-object-x-dynamic.js"></SCRIPT>
<SCRIPT LANGUAGE=JavaScript><!-- //
// ***************************
// SOME SONIFICATION SCRIPTING
// ***************************
// --></SCRIPT>
<!-- ****************** -->
<!-- SOME SONIFIED HTML -->
<!-- ****************** -->
</BODY></HTML>
|
With the majority of extensions, it doesn't matter in which order you source in the extensions, as long as they are all sourced in following the "music-object.js" file, and not before it. If you source in an extension file before sourcing in "music-object.js", the extension simply will not work. This would be similar to trying to use a JavaScript function before you have defined it. In order to extend the Music Object, it first needs to be defined (which is done by sourcing it in).
In most cases, extensions have been designed to be independent of other extensions. However, there may be some exceptions to this rule, as it is possible that an extension may require some of the features of another extension in order to function correctly. To be 100% certain of the order in which extensions should be sourced in, consult the documentation for individual extensions to find out what their dependencies are. As a simple rule, if an extension depends on another extension, then that required extension should be sourced in before the extension that depends on it.
|
What Extensions are Available?
|
The Music Object extensions listed below are released and fully documented. Other exciting extensions are currently under development. In the table, each extension name is linked to the full reference for the extension.
| Extension Name |
Short Description |
| Auto Disengage |
Provides features to help alleviate the conflicts that may occur in some system configurations when the Beatnik Player and other audio players are being used together in the same Web site. |
| Callbacks |
Offers methods that allow multiple callback handlers to be registered for each callback type, letting different code modules share a Music Object instance's callbacks without overriding each others registered callbacks. Also allows handlers to be assigned to specific meta events that occur within RMF (and MIDI) files. |
| Channels |
Provides methods for more conveniently querying and modifying properties of MIDI channels. Most of these properties can be set using the core Music Object setController method, so this extension is provided primarily to ease programming. |
| Chords |
Adds instance and static methods that make it easier to play musical chords using a chord syntax that is familiar to musicians. |
| Clip |
Provides a set of services for conveniently creating a music preview system on a Web page. |
| Debug |
Adds debugging capabilities that can help in locating errors in sonified content. These debugging features were built into the core Music Object API in versions before 3.2.x, but are now being made available as an optional extension. |
| Ducking |
Provides methods for linking instances to one another and setting up automated ducking relationships - much like the ducking effect used so often in radio broadcasting. |
| Dynamic |
Offers methods that help in creating sonified Web site content that remains fresh and can hold up to repeat visits. |
| Fades |
Adds features that are useful in the design of realtime music remixing applications, such as methods for fading MIDI continuous controller values and fading playback tempo, as well as a generic fade method and a Fade object that can be used to create custom fades for any controllable musical parameters. |
| Flash |
Makes it easier to configure Web pages so that Flash movies can be sonified using the power of Beatnik's interactive music and audio capabilities. |
| Groups |
Offers methods that make it easier to program Web-based "remix" interfaces, where musical compositions are "performed" as the user switches on and switches off different parts of the music - these parts often being made up of multiple MIDI channels or tracks. |
| Group Volume |
Provides methods for conveniently adjusting the overall volume of entire groups of Music Object instances, including a sonified page's overall volume. |
| Instruments |
Offers methods that allow Web-based music applications to offer meaningful instrument names, rather than just program numbers. |
| Note Effects |
Provides methods for easily creating outrageous sound effects using just musical notes. |
| Snapshots |
Provides methods for easily capturing and restoring mix snapshots for RMF and MIDI files that are playing. |
| Song Info |
Provides additional features for displaying an RMF file's copyright information. |
| Tracing |
Provides an easy way to watch calls to methods of the Music Object API and is a very useful tool to have when debugging sonification code. |
| Wizards |
Adds methods that let you easily sonify all form elements and links on a page in a single step, without having to add JavaScript code to all the elements you wish to sonify. |
|
|
|
Building Extensions Into a Suite
|
 |
If you find yourself regularly using a particular extension (or group of extensions) in all your sonified Web pages, then you may wish to consider building a Music Object suite to simplify your authoring and to make your life a little easier. For more information, consult the section Making a Custom Music Object Suite
|
Creating Your Own Extensions
|
 |
If you find yourself often adding on to the Music Object API by defining your own custom functions to take care of common sonification tasks, you may wish to consider building your own custom Music Object extension. By building an extension, you can more tightly integrate your higher level sonification functions into the Music Object API in the form of instance methods and static methods. And if your extension is judged to be well implemented and of demonstrable value to sonified content developers, there is even the possibility that it could be included as part of the official set of Music Object extensions.
To develop your own extensions, you should consult the reference for the Music Object Extensibility API.